﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CTP.Entitys
{
    /// <summary>
    /// 账户类型
    /// </summary>
    public enum AccountType
    {
        /// <summary>
        /// 股票账户
        /// </summary>
        Stock,
        /// <summary>
        /// 期货账户
        /// </summary>
        Futrue
    }

    /// <summary>
    /// 买卖多空方向
    /// </summary>
    public enum Side
    {
        /// <summary>
        /// 买
        /// </summary>
        Buy,
        /// <summary>
        /// 卖
        /// </summary>
        Sell
    }

    /// <summary>
    /// 持仓方向
    /// </summary>
    public enum PosSide
    {
        /// <summary>
        /// 多
        /// </summary>
        More,
        /// <summary>
        /// 空
        /// </summary>
        Short,
        /// <summary>
        /// 清
        /// </summary>
        Clear
    }

    /// <summary>
    /// 市场
    /// </summary>
    public enum Exchange
    {
        /// <summary>
        /// 上海A股/上交所
        /// </summary>
        SHA,
        /// <summary>
        /// 深圳A股/深交所
        /// </summary>
        SZA,
        /// <summary>
        /// 大连商品期货交易所
        /// </summary>
        DLE,
        /// <summary>
        /// 郑州商品期货交易所
        /// </summary>
        ZZE,
        /// <summary>
        /// 上海商品期货交易所
        /// </summary>
        SHE,
        /// <summary>
        /// 中金所
        /// </summary>
        CFFEX

    }

    /// <summary>
    /// 开平标志
    /// </summary>
    public enum OpenClose
    {
        /// <summary>
        /// 开仓
        /// </summary>
        Open,
        /// <summary>
        /// 平仓
        /// </summary>
        Close,
        /// <summary>
        /// 平今
        /// </summary>
        CloseToday,
        /// <summary>
        /// 平昨
        /// </summary>
        CloseYestoday,
        /// <summary>
        /// 强平
        /// </summary>
        ForceClose
    }

    /// <summary>
    /// 价格模式
    /// </summary>
    public enum PriceMode
    {
        /// <summary>
        /// 限价
        /// </summary>
        LimitPrice,
        /// <summary>
        /// 市价委托--最新价(默认)
        /// </summary>
        LastPrice,
        /// <summary>
        /// 市价委托
        /// </summary>
        MarketPrice,
        /// <summary>
        /// 市价委托--本方最优价
        /// </summary>
        MarketPriceThisSide,
        /// <summary>
        /// 市价委托--对手方最优价
        /// </summary>
        MarketPriceThatSide,
        /// <summary>
        /// 市价委托--即时成交剩余撤销
        /// </summary>
        MarketPriceCancelRest,
        /// <summary>
        /// 市价委托--最优五档即时成交剩余转限价
        /// </summary>
        MarketPriceLimitedRest
    }

    public enum HedgeFlag
    {
        /// <summary>
        /// 投机
        /// </summary>
        Speculation = 1,
        /// <summary>
        /// 套保
        /// </summary>
        Hedge = 3
    }

    /// <summary>
    /// 委托单状态
    /// </summary>
    public enum OrderState
    {
        /// <summary>
        /// 未知
        /// </summary>
        Unknow,

        /// <summary>
        /// 未报
        /// </summary>
        UnAck,
        /// <summary>
        /// 已在队列，状态待确认
        /// </summary>
        ToBeConfirmed,
        /// <summary>
        /// 待报
        /// </summary>
        ToBeReported,
        /// <summary>
        /// 正在申报
        /// </summary>
        Reporting,
        /// <summary>
        /// 已报
        /// </summary>
        Reported,
        /// <summary>
        /// 已报待撤
        /// </summary>
        ReportedCancel,
        /// <summary>
        /// 部成待撤
        /// </summary>
        PartFillAndCancelling,
        /// <summary>
        /// 部成已撤
        /// </summary>    
        PartFilledAndCancelled,
        /// <summary>
        /// 已撤
        /// </summary>
        Canceled,
        /// <summary>
        /// 部成
        /// </summary>
        PartFilled,
        /// <summary>
        /// 已成
        /// </summary>
        Filled,
        /// <summary>
        /// 下单拒绝
        /// </summary>
        PlaceRejected,
        /// <summary>
        /// 撤单拒绝
        /// </summary>
        CancelRejected
    }
    /// <summary>
    /// 币种
    /// </summary>
    public enum Currency
    {
        /// <summary>
        /// 人民币
        /// </summary>
        RMB,
        /// <summary>
        /// 美元
        /// </summary>
        USD,
        /// <summary>
        /// 港币
        /// </summary>
        HKD
    }
    public enum PositionDateType
    {
        UseHistory, NoUseHistory
    }
    /// <summary>
    /// 股/手/张  单位
    /// </summary>
    public enum Unit
    {
        /// <summary>
        /// 手
        /// </summary>
        Hand,
        /// <summary>
        /// 股
        /// </summary>
        Section,
        /// <summary>
        /// 张
        /// </summary>
        Piece
    }
    /// <summary>
    /// 证券类别，暂只分股票、期货
    /// </summary>
    public enum Category
    {
        /// <summary>
        /// 股票
        /// </summary>
        Stock,
        /// <summary>
        /// 期货
        /// </summary>
        Futures,
    }

    /// <summary>
    /// 订阅流类型
    /// </summary>
    public enum SubscribeType
    {
        /// <summary>
        /// 从当天的第一条记录开始接收数据流
        /// </summary>
        TERT_RESTART = 0,
        /// <summary>
        /// 接收上次断线以后的数据流
        /// </summary>
        RESUME = 1,
        /// <summary>
        /// 接收本次登入以后的数据流
        /// </summary>
        TERT_QUICK = 2
    }

    /// <summary>
    /// 报单价格条件
    /// </summary>

    public enum TThostFtdcOrderPriceType : sbyte
    {
        /// <summary>
        /// 任意价
        /// </summary>
        THOST_FTDC_OPT_AnyPrice = (sbyte)'1',
        /// <summary>
        /// 限价
        /// </summary>
        THOST_FTDC_OPT_LimitPrice = (sbyte)'2',
        /// <summary>
        /// 最优价
        /// </summary>
        THOST_FTDC_OPT_BestPrice = (sbyte)'3',
        /// <summary>
        /// 最新价
        /// </summary>
        THOST_FTDC_OPT_LastPrice = (sbyte)'4',
        /// <summary>
        /// 最新价浮动上浮1个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_LastPricePlusOneTicks = (sbyte)'5',
        /// <summary>
        /// 最新价浮动上浮2个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_LastPricePlusTwoTicks = (sbyte)'6',
        /// <summary>
        /// 最新价浮动上浮3个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_LastPricePlusThreeTicks = (sbyte)'7',
        /// <summary>
        /// 卖一价
        /// </summary>
        THOST_FTDC_OPT_AskPrice1 = (sbyte)'8',
        /// <summary>
        /// 卖一价浮动上浮1个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_AskPrice1PlusOneTicks = (sbyte)'9',
        /// <summary>
        /// 卖一价浮动上浮2个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_AskPrice1PlusTwoTicks = (sbyte)'A',
        /// <summary>
        /// 卖一价浮动上浮3个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_AskPrice1PlusThreeTicks = (sbyte)'B',
        /// <summary>
        /// 买一价
        /// </summary>
        THOST_FTDC_OPT_BidPrice1 = (sbyte)'C',
        /// <summary>
        /// 买一价浮动上浮1个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_BidPrice1PlusOneTicks = (sbyte)'D',
        /// <summary>
        /// 买一价浮动上浮2个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_BidPrice1PlusTwoTicks = (sbyte)'E',
        /// <summary>
        /// 买一价浮动上浮3个ticks（波动点）
        /// </summary>
        THOST_FTDC_OPT_BidPrice1PlusThreeTicks = (sbyte)'F'
    }

    /// <summary>
    /// 买卖方向
    /// </summary>
    public enum TFtdcDirectionType : sbyte
    {
        /// <summary>
        /// 买
        /// </summary>
        THOST_FTDC_D_Buy = (sbyte)'0',
        /// <summary>
        /// 卖
        /// </summary>
        THOST_FTDC_D_Sell = (sbyte)'1'
    }

    /// <summary>
    /// 开平标志类型
    /// </summary>
    public enum TThostFtdcOffsetFlagType : sbyte
    {
        /// <summary>
        /// 开仓
        /// </summary>
        THOST_FTDC_OF_Open = (sbyte)'0',
        /// <summary>
        /// 平仓
        /// </summary>
        THOST_FTDC_OF_Close = (sbyte)'1',
        /// <summary>
        /// 强平
        /// </summary>
        THOST_FTDC_OF_ForceClose = (sbyte)'2',
        /// <summary>
        /// 平今
        /// </summary>
        THOST_FTDC_OF_CloseToday = (sbyte)'3',
        /// <summary>
        /// 平昨
        /// </summary>
        THOST_FTDC_OF_CloseYesterday = (sbyte)'4'
    }

    /// <summary>
    /// 投机套保标志
    /// </summary>
    public enum TThostFtdcHedgeFlagType : sbyte
    {
        /// <summary>
        /// 投机
        /// </summary>
        THOST_FTDC_HF_Speculation = (sbyte)'1',
        /// <summary>
        /// 套保
        /// </summary>
        THOST_FTDC_HF_Hedge = (sbyte)'3'
    }

    /// <summary>
    /// 有效期类型
    /// </summary>
    public enum TThostFtdcTimeConditionType : sbyte
    {
        /// <summary>
        /// 立即完成，否则撤销
        /// </summary>
        THOST_FTDC_TC_IOC = (sbyte)'1',
        /// <summary>
        /// 本节有效
        /// </summary>
        THOST_FTDC_TC_GFS = (sbyte)'2',
        /// <summary>
        /// 当日有效
        /// </summary>
        THOST_FTDC_TC_GFD = (sbyte)'3',
        /// <summary>
        /// 指定日期前有效
        /// </summary>
        THOST_FTDC_TC_GTD = (sbyte)'4',
        /// <summary>
        /// 撤销前有效
        /// </summary>
        THOST_FTDC_TC_GTC = (sbyte)'5',
        /// <summary>
        /// 集合竞价有效
        /// </summary>
        THOST_FTDC_TC_GFA = (sbyte)'6'
    }

    /// <summary>
    /// 成交量类型
    /// </summary>
    public enum TThostFtdcVolumeConditionType : sbyte
    {
        /// <summary>
        /// 任何数量
        /// </summary>
        THOST_FTDC_VC_AV = (sbyte)'1',
        /// <summary>
        /// 最小数量
        /// </summary>
        THOST_FTDC_VC_MV = (sbyte)'2',
        /// <summary>
        /// 全部数量
        /// </summary>
        THOST_FTDC_VC_CV = (sbyte)'3'
    }

    /// <summary>
    /// 触发条件类型
    /// </summary>
    public enum TThostFtdcContingentConditionType : sbyte
    {
        /// <summary>
        /// 立即
        /// </summary>
        THOST_FTDC_CC_Immediately = (sbyte)'1',
        /// <summary>
        /// 止损
        /// </summary>
        THOST_FTDC_CC_Touch = (sbyte)'2',
        /// <summary>
        /// 止赢
        /// </summary>
        THOST_FTDC_CC_TouchProfit = (sbyte)'3',
        /// <summary>
        /// 预埋单
        /// </summary>
        THOST_FTDC_CC_ParkedOrder = (sbyte)'4',
        /// <summary>
        /// 条件价大于最新价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterThanLastPrice = (sbyte)'5',
        /// <summary>
        /// 条件价大于等于最新价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterEqualLastPrice = (sbyte)'6',
        /// <summary>
        /// 条件价小于最新价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserThanLastPrice = (sbyte)'7',
        /// <summary>
        /// 条件价小于等于最新价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserEqualLastPrice = (sbyte)'8',
        /// <summary>
        /// 条件价大于卖一价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterThanAskPrice = (sbyte)'9',
        /// <summary>
        /// 条件价大于等于卖一价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterEqualAskPrice = (sbyte)'A',
        /// <summary>
        /// 条件价小于卖一价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserThanAskPrice = (sbyte)'B',
        /// <summary>
        /// 条件价小于等于卖一价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserEqualAskPrice = (sbyte)'C',
        /// <summary>
        /// 条件价大于买一价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterThanBidPrice = (sbyte)'D',
        /// <summary>
        /// 条件价大于等于买一价
        /// </summary>
        THOST_FTDC_CC_StopPriceGreaterEqualBidPrice = (sbyte)'E',
        /// <summary>
        /// 条件价小于买一价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserThanBidPrice = (sbyte)'F',
        /// <summary>
        /// 条件价小于等于买一价
        /// </summary>
        THOST_FTDC_CC_StopPriceLesserEqualBidPrice = (sbyte)'a'
    }

    /// <summary>
    /// 强平原因
    /// </summary>
    public enum TFtdcForceCloseReasonType : sbyte
    {
        /// <summary>
        /// 非强平
        /// </summary>
        THOST_FTDC_FCC_NotForceClose = (sbyte)'0',
        /// <summary>
        /// 资金不足
        /// </summary>
        THOST_FTDC_FCC_LackDeposit = (sbyte)'1',
        /// <summary>
        /// 客户超仓
        /// </summary>
        THOST_FTDC_FCC_ClientOverPositionLimit = (sbyte)'2',
        /// <summary>
        /// 会员超仓
        /// </summary>
        THOST_FTDC_FCC_MemberOverPositionLimit = (sbyte)'3',
        /// <summary>
        /// 持仓非整数倍
        /// </summary>
        THOST_FTDC_FCC_NotMultiple = (sbyte)'4',
        /// <summary>
        /// 违规
        /// </summary>
        THOST_FTDC_FCC_Violation = (sbyte)'5',
        /// <summary>
        /// 其它
        /// </summary>
        THOST_FTDC_FCC_Other = (sbyte)'6'
    }

    /// <summary>
    /// 报单提交状态
    /// </summary>
    public enum TThostFtdcOrderSubmitStatus : sbyte
    {
        /// <summary>
        /// 已经提交
        /// </summary>
        THOST_FTDC_OSS_InsertSubmitted = (sbyte)'0',
        /// <summary>
        /// 撤单已经提交
        /// </summary>
        THOST_FTDC_OSS_CancelSubmitted = (sbyte)'1',
        /// <summary>
        /// 修改已经提交
        /// </summary>
        THOST_FTDC_OSS_ModifySubmitted = (sbyte)'2',
        /// <summary>
        /// 已经接受
        /// </summary>
        THOST_FTDC_OSS_Accepted = (sbyte)'3',
        /// <summary>
        /// 报单已经被拒绝
        /// </summary>
        THOST_FTDC_OSS_InsertRejected = (sbyte)'4',
        /// <summary>
        /// 撤单已经被拒绝
        /// </summary>
        THOST_FTDC_OSS_CancelRejected = (sbyte)'5',
        /// <summary>
        /// 改单已经被拒绝
        /// </summary>
        THOST_FTDC_OSS_ModifyRejected = (sbyte)'6'
    }

    /// <summary>
    /// 报单状态类型
    /// </summary>
    public enum TThostFtdcOrderStatus : sbyte
    {
        /// <summary>
        /// 全部成交
        /// </summary>
        THOST_FTDC_OST_AllTraded = (sbyte)'0',
        /// <summary>
        /// 部分成交还在队列中
        /// </summary>
        THOST_FTDC_OST_PartTradedQueueing = (sbyte)'1',
        /// <summary>
        /// 部分成交不在队列中
        /// </summary>
        THOST_FTDC_OST_PartTradedNotQueueing = (sbyte)'2',
        /// <summary>
        /// 未成交还在队列中
        /// </summary>
        THOST_FTDC_OST_NoTradeQueueing = (sbyte)'3',
        /// <summary>
        /// 未成交不在队列中
        /// </summary>
        THOST_FTDC_OST_NoTradeNotQueueing = (sbyte)'4',
        /// <summary>
        /// 撤单
        /// </summary>
        THOST_FTDC_OST_Canceled = (sbyte)'5',
        /// <summary>
        /// 未知
        /// </summary>
        THOST_FTDC_OST_Unknown = (sbyte)'a',
        /// <summary>
        /// 尚未触发
        /// </summary>
        THOST_FTDC_OST_NotTouched = (sbyte)'b'
    }

    /// <summary>
    /// 操作标志
    /// </summary>
    public enum TFtdcActionFlag : sbyte
    {
        /// <summary>
        /// 删除
        /// </summary>
        THOST_FTDC_AF_Delete = (sbyte)'0',
        /// <summary>
        /// 修改
        /// </summary>
        THOST_FTDC_AF_Modify = (sbyte)'3'
    }

    /// <summary>
    /// 持仓多空方向标志
    /// </summary>
    public enum TThostFtdcPosiDirection : sbyte
    {
        /// <summary>
        /// 净
        /// </summary>
        THOST_FTDC_PD_Net = (sbyte)'1',
        /// <summary>
        /// 多头
        /// </summary>
        THOST_FTDC_PD_Long = (sbyte)'2',
        /// <summary>
        /// 空头
        /// </summary>
        THOST_FTDC_PD_Short = (sbyte)'3'
    }

    public enum TThostFtdcPositionDateTypeType : sbyte
    {
        /// <summary>
        /// 使用历史持仓
        /// </summary>
        THOST_FTDC_PDT_UseHistory = (sbyte)'1',
        /// <summary>
        /// 不使用历史持仓
        /// </summary>
        THOST_FTDC_PDT_NoUseHistory = (sbyte)'2'
    }
}
